package com.yanmaohu.yulia.statement;

import com.yanmaohu.yulia.bean.InsertColumnsAndSource;
import com.yanmaohu.yulia.bean.LocalOrSchemaQualifiedName;

/**
 * @author Bright Lee
 */
public final class InsertStatement implements SqlDataChangeStatement, Statement {

    private int beginIndex;
    private int endIndex;
    private LocalOrSchemaQualifiedName insertionTarget;
    private InsertColumnsAndSource insertColumnsAndSource;

    public InsertStatement(int beginIndex, LocalOrSchemaQualifiedName insertionTarget, InsertColumnsAndSource insertColumnsAndSource) {
        this.beginIndex = beginIndex;
        this.endIndex = insertColumnsAndSource.getEndIndex();
        this.insertionTarget = insertionTarget;
        this.insertColumnsAndSource = insertColumnsAndSource;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public LocalOrSchemaQualifiedName getInsertionTarget() {
        return insertionTarget;
    }

    public InsertColumnsAndSource getInsertColumnsAndSource() {
        return insertColumnsAndSource;
    }

}
